UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'oQJ9xtLkaqvTD5JEcHc5oz8kOIOmoRCA+VSIAt9JrlE=' 
WHERE 
  key_id = 'dbb8d4dbcceaa5a43c2d5bdd555e4a978fe105de7a78404b8b7340023c14d869' 
  AND (
    token = 'oQJ9xtLkaqvTD5JEcHc5oz8kOIOmoRCA+VSIAt9JrlE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045