UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+kYDHEFGTZprIsDlJxaZ8/2ihmNGLEz6u/nNmUy1IA4='
WHERE
key_id = '12c95899a646987dfa8c52ced845c41474b0ff6c240bcf7208ca5df6a20a4601'
AND (
token = '+kYDHEFGTZprIsDlJxaZ8/2ihmNGLEz6u/nNmUy1IA4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)