UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rl85O2Sow+jLN1KhL58fNUUnUg/cvIbRvdCMEo39nWI='
WHERE
key_id = '9c06f8acc1186fe7cc71a578ceeecd99dddb79048b38f2021793c7c5d2023268'
AND (
token = 'rl85O2Sow+jLN1KhL58fNUUnUg/cvIbRvdCMEo39nWI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)