UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 's+7EjwiMOuz7HgwWC/OBrgttaFRK8tcd3hdQf4PP5/c=' 
WHERE 
  key_id = 'fdd7049048026a4c9fa8dbfa16a24476f4fe94e54887e0c697ca3784081f9714' 
  AND (
    token = 's+7EjwiMOuz7HgwWC/OBrgttaFRK8tcd3hdQf4PP5/c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031