UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+hmKWtTpNMDP/ZsMvsDxVV7gcK1ltldDvCk/n0CbNX0=' 
WHERE 
  key_id = 'a2ee838a481d66538def91c6a26f4a67e190fd30033e2bd852266c54f8aac044' 
  AND (
    token = '+hmKWtTpNMDP/ZsMvsDxVV7gcK1ltldDvCk/n0CbNX0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035