UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'E0NNuzNCuycfD+IawSTwEWmPqM8lwvfmZ9aF3GHBtL8='
WHERE
key_id = 'ce5941cb652c17260cd784e71b6e807d937e43f32db3d1842e2985357d83792a'
AND (
token = 'E0NNuzNCuycfD+IawSTwEWmPqM8lwvfmZ9aF3GHBtL8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)