UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1DuEf2+GAR+zlrT7WWYavW0jiefqBP3rSnZqZQ1J2tg='
WHERE
key_id = '6ed8c567a1e46b6cace94c2439b2770cf8f150f0fb0b014338b6fb1f39809b6b'
AND (
token = '1DuEf2+GAR+zlrT7WWYavW0jiefqBP3rSnZqZQ1J2tg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)