UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Iy2L6GS86HyfGkKNHDLjxvd8eT83hNk1hOLTKoAGmsY='
WHERE
key_id = '741b0cc4ef06a160d51b97b65d37bd182f59cb04c69a4a861c63bd489632ed5b'
AND (
token = 'Iy2L6GS86HyfGkKNHDLjxvd8eT83hNk1hOLTKoAGmsY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)