UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'NwdiWdctGiGi4DJpd5jZv6cQyI3FhXqnrH7QbJXSN14='
WHERE
key_id = '73fce8d7bd67152b631aeb16a5127ad97abc53d6051886a7cd8d8ffac7111c47'
AND (
token = 'NwdiWdctGiGi4DJpd5jZv6cQyI3FhXqnrH7QbJXSN14='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)