UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3aWqKsJ/mhs0Y8udtV6oSLYEbYoJVlioqNfkQoZi3Vw='
WHERE
key_id = 'e33a203b728b26adc8cd6a69e8363c0b8a7d931b60da03bbc410cf8d5c76fc25'
AND (
token = '3aWqKsJ/mhs0Y8udtV6oSLYEbYoJVlioqNfkQoZi3Vw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)