UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ulwmWGNingNty8f7v9yfiw4aWn2uXq5tn5pdGQK2/7k=' 
WHERE 
  key_id = '1ea6952eb31c5bdffe9f36c6c6ef3e6a310d9d8451deb3ab44746c85c71d9078' 
  AND (
    token = 'ulwmWGNingNty8f7v9yfiw4aWn2uXq5tn5pdGQK2/7k=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035