UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pKGXoqiUZt+eWB1sXUr3dMjGN3xVmPmE/s20/laMxcc='
WHERE
key_id = '9d9d1cc0558410fe0538787a2253a732b47f0584d727ae01e053d607bd3fa5af'
AND (
token = 'pKGXoqiUZt+eWB1sXUr3dMjGN3xVmPmE/s20/laMxcc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)