UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8b1Pqczk+Rq92YuD3cOWFDmRvvgGwBnCdneLhWwfJZ4='
WHERE
key_id = 'e820aaf4ffd513553f33a1409319a280671476c2344e8103240f47de87e627bd'
AND (
token = '8b1Pqczk+Rq92YuD3cOWFDmRvvgGwBnCdneLhWwfJZ4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)