UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '602iuC6WI6YYXP7Oxc4ejGnpzdBlvxTVADdogQYQUN0='
WHERE
key_id = '2df4b02312997e89b4a17c7a5d712ef29e5026f7d4eaece1ddad5a2f2ca39c26'
AND (
token = '602iuC6WI6YYXP7Oxc4ejGnpzdBlvxTVADdogQYQUN0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)