UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'G+lRgv3GWVE4lyv4W7Bmccj3BAPqPh28p4oq+kb5sJ4='
WHERE
key_id = '3a7f91b57297640ff40eed067b561fd81cd8e359d09ff13a69aa1f46d2eb0f64'
AND (
token = 'G+lRgv3GWVE4lyv4W7Bmccj3BAPqPh28p4oq+kb5sJ4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)