UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1MRb1NsMec2/EIJdPo2Ca/rAqNvUP8ISTIEzqNg8xFY='
WHERE
key_id = 'ccd488da3654385fa2fc13ab0f6e71deb82e70cb9e059596597259ec49a171d7'
AND (
token = '1MRb1NsMec2/EIJdPo2Ca/rAqNvUP8ISTIEzqNg8xFY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)