UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hTYtgRJTMz1zcQ8MF8aJZNT2hG7aMSyiDRqQdS7R4qc='
WHERE
key_id = '78a672e8cc32253ee73d6de62e13a81b7b1cbac360063ab07c8ee1b37a758f12'
AND (
token = 'hTYtgRJTMz1zcQ8MF8aJZNT2hG7aMSyiDRqQdS7R4qc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)