UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'eYSculhzqVafaCxKGSLD8EgPwmaMQBGKb/WtflqI/SA='
WHERE
key_id = 'db17513f8102f493f42f242ec6b77674c0da78bbee5891b353d29232e53f3def'
AND (
token = 'eYSculhzqVafaCxKGSLD8EgPwmaMQBGKb/WtflqI/SA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)