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

Query time 0.00045