UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'EvN0H/Ta4n1DsngqPMyIK2XTXxHlsoOFkwxwSN1+0+s=' 
WHERE 
  key_id = '2d79d5c1bbc3986f4c327d9f20f91694913f95caccab030e27afff86d9ffa354' 
  AND (
    token = 'EvN0H/Ta4n1DsngqPMyIK2XTXxHlsoOFkwxwSN1+0+s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032