UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WsL309/hnEsBnbpPKlUJtpf2fmSj4UGSgcqFG6cuK1E='
WHERE
key_id = 'a93e9460e94cd030ea210a604250df4f6bae1be24f86e9b48df5d4f2d6828f20'
AND (
token = 'WsL309/hnEsBnbpPKlUJtpf2fmSj4UGSgcqFG6cuK1E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)