UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'eMFw2ec7aAKMjWLZYJ5XEOSbsT9zfkJzQUT2c14hL0k='
WHERE
key_id = '78222aa3549552810fb1a9f43d3fc99ebd4191c4318921b11071f614b8e7d4ee'
AND (
token = 'eMFw2ec7aAKMjWLZYJ5XEOSbsT9zfkJzQUT2c14hL0k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)