UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'x3fUwvgVDNHk8kc+c0CmG7hdWojgsrYsIK9zCU75PX8='
WHERE
key_id = '23911a229577b303fbbd5b5e90fe60fde4aa453e0da7f2bd91fa3bc70cd4f532'
AND (
token = 'x3fUwvgVDNHk8kc+c0CmG7hdWojgsrYsIK9zCU75PX8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)