UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '09/PhirUpViUWxx6EJ3bzi0OFYXQ1XoDk1SIyKN6cAE=' 
WHERE 
  key_id = '1d5b08bc7f7ca886354f7c5076fa70a225b458a283764e956333ec716f8e05e1' 
  AND (
    token = '09/PhirUpViUWxx6EJ3bzi0OFYXQ1XoDk1SIyKN6cAE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00054