UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8qtVGa5+F0I2yMsy+pcAo2XadDhORgH1uZYOwbFG+Ew='
WHERE
key_id = 'b7709daf1f5f5ba2a35b76136df6f0a3ac501325e7bb0f715ee5e62621174111'
AND (
token = '8qtVGa5+F0I2yMsy+pcAo2XadDhORgH1uZYOwbFG+Ew='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)