UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Mnq4S7ku1jxZojiNJUTSKHNgUDKz+f2JMdnsW5ptfFE=' 
WHERE 
  key_id = '1fdbdec681774daf69095e6c235ba90b0f30852dcce495bc451a77c15c8844f4' 
  AND (
    token = 'Mnq4S7ku1jxZojiNJUTSKHNgUDKz+f2JMdnsW5ptfFE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033