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

Query time 0.00023