UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PCgYkGYGbI6Zf4Zg10C+46iHPmkW1ZT8lxGR941bpTY='
WHERE
key_id = '2aba1cc1c66d8a055d2d7428e82d9476a6855e535d6797cf90b2e475cc501b4a'
AND (
token = 'PCgYkGYGbI6Zf4Zg10C+46iHPmkW1ZT8lxGR941bpTY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)