UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '77cBmfS8nWQlKZJ3OYP2IkTWVRhaq1X1O7+KalSGgag='
WHERE
key_id = '6768da60879261797fb9e164199d0ca22456fc4c805b4c748a26cfefcc7cef0f'
AND (
token = '77cBmfS8nWQlKZJ3OYP2IkTWVRhaq1X1O7+KalSGgag='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)