UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lGtTw0jlYqMyiGJ6x2s3TBnvStlcPF8CP3xR0jJaRY8='
WHERE
key_id = '83f9d040cd51f526d6d6f4f13636b62cd360671516e5b44e1986d09edd39f342'
AND (
token = 'lGtTw0jlYqMyiGJ6x2s3TBnvStlcPF8CP3xR0jJaRY8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)