UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'csYSfVXA8kNLYfiyiBPJJC3oeacxvRFlch61jrDgLzg=' 
WHERE 
  key_id = 'eb890f503cea2e890686737d1b9ab9d61673c07225e999dda09f0adac7e0af33' 
  AND (
    token = 'csYSfVXA8kNLYfiyiBPJJC3oeacxvRFlch61jrDgLzg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029