UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'f3c0xqpEaQx1iSZGUTQ2bXdCv7k/KVQ/loNafsiTo/I=' 
WHERE 
  key_id = 'ac5f3b53a068be70b9796f1a3fa30f7cfceeaccdeff3fac938143da5363d3494' 
  AND (
    token = 'f3c0xqpEaQx1iSZGUTQ2bXdCv7k/KVQ/loNafsiTo/I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032