UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MT+ulylzKZ8Q4Q+BlrNpnzgFYFR5DODjW4Nuh4lINaQ=' 
WHERE 
  key_id = 'c103d6629818ae3b66c46c61c5ea01e9b3eb84ad5b005033645b9e77f64d2a11' 
  AND (
    token = 'MT+ulylzKZ8Q4Q+BlrNpnzgFYFR5DODjW4Nuh4lINaQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024